const router = require('koa-router')()

router.post('/', async (ctx, next) => {

  let data = ctx.request.body
  if (data.username === 'admin' && data.password === '123456') {
    ctx.body = { message: '登录成功！' }
    ctx.status = 200
  } else {
    ctx.throw(500, { message: '用户名或密码错误！' })
  }


})

module.exports = router